<?php
header('Content-Type: application/json');
require_once '../model/conn.php';

$rid = isset($_POST['rid']) ? $_POST['rid'] : 0;

if ($rid <= 0) {
  echo json_encode(["code" => 500, "msg" => "请求失败"]);
  exit;
}

//删除所有的rep之后再删除com
$sqlReps = "delete from tbl_reply where reply_id =$rid;";
$rows1 = exec_update($sqlReps);
if ($rows1 > 0) {
  echo json_encode(["code" => 200, "msg" => "删除回复成功", "num" => $rows1, "row1" => $rows1]);
  exit;
} else {
  echo json_encode(["code" => 500, "msg" => "删除回复失败", "num" => null, "row1" => $rows1]);
  exit;
}

?>